3.1.87 \(\int \sec ^8(c+d x) (a \cos (c+d x)+b \sin (c+d x))^4 \, dx\) [87]

3.1.87.1 Optimal result
3.1.87.2 Mathematica [A] (verified)
3.1.87.3 Rubi [A] (verified)
3.1.87.4 Maple [A] (verified)
3.1.87.5 Fricas [A] (verification not implemented)
3.1.87.6 Sympy [F(-1)]
3.1.87.7 Maxima [A] (verification not implemented)
3.1.87.8 Giac [A] (verification not implemented)
3.1.87.9 Mupad [B] (verification not implemented)

3.1.87.1 Optimal result

Integrand size = 28, antiderivative size = 143 \[ \int \sec ^8(c+d x) (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=\frac {a^4 \tan (c+d x)}{d}+\frac {2 a^3 b \tan ^2(c+d x)}{d}+\frac {a^2 \left (a^2+6 b^2\right ) \tan ^3(c+d x)}{3 d}+\frac {a b \left (a^2+b^2\right ) \tan ^4(c+d x)}{d}+\frac {b^2 \left (6 a^2+b^2\right ) \tan ^5(c+d x)}{5 d}+\frac {2 a b^3 \tan ^6(c+d x)}{3 d}+\frac {b^4 \tan ^7(c+d x)}{7 d} \]

output
a^4*tan(d*x+c)/d+2*a^3*b*tan(d*x+c)^2/d+1/3*a^2*(a^2+6*b^2)*tan(d*x+c)^3/d 
+a*b*(a^2+b^2)*tan(d*x+c)^4/d+1/5*b^2*(6*a^2+b^2)*tan(d*x+c)^5/d+2/3*a*b^3 
*tan(d*x+c)^6/d+1/7*b^4*tan(d*x+c)^7/d
 
3.1.87.2 Mathematica [A] (verified)

Time = 0.62 (sec) , antiderivative size = 54, normalized size of antiderivative = 0.38 \[ \int \sec ^8(c+d x) (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=\frac {(a+b \tan (c+d x))^5 \left (a^2+21 b^2-5 a b \tan (c+d x)+15 b^2 \tan ^2(c+d x)\right )}{105 b^3 d} \]

input
Integrate[Sec[c + d*x]^8*(a*Cos[c + d*x] + b*Sin[c + d*x])^4,x]
 
output
((a + b*Tan[c + d*x])^5*(a^2 + 21*b^2 - 5*a*b*Tan[c + d*x] + 15*b^2*Tan[c 
+ d*x]^2))/(105*b^3*d)
 
3.1.87.3 Rubi [A] (verified)

Time = 0.31 (sec) , antiderivative size = 129, normalized size of antiderivative = 0.90, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3042, 3567, 522, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \sec ^8(c+d x) (a \cos (c+d x)+b \sin (c+d x))^4 \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {(a \cos (c+d x)+b \sin (c+d x))^4}{\cos (c+d x)^8}dx\)

\(\Big \downarrow \) 3567

\(\displaystyle -\frac {\int (b+a \cot (c+d x))^4 \left (\cot ^2(c+d x)+1\right ) \tan ^8(c+d x)d\cot (c+d x)}{d}\)

\(\Big \downarrow \) 522

\(\displaystyle -\frac {\int \left (b^4 \tan ^8(c+d x)+4 a b^3 \tan ^7(c+d x)+\left (b^4+6 a^2 b^2\right ) \tan ^6(c+d x)+4 a b \left (a^2+b^2\right ) \tan ^5(c+d x)+\left (a^4+6 b^2 a^2\right ) \tan ^4(c+d x)+4 a^3 b \tan ^3(c+d x)+a^4 \tan ^2(c+d x)\right )d\cot (c+d x)}{d}\)

\(\Big \downarrow \) 2009

\(\displaystyle -\frac {-a^4 \tan (c+d x)-2 a^3 b \tan ^2(c+d x)-\frac {1}{5} b^2 \left (6 a^2+b^2\right ) \tan ^5(c+d x)-a b \left (a^2+b^2\right ) \tan ^4(c+d x)-\frac {1}{3} a^2 \left (a^2+6 b^2\right ) \tan ^3(c+d x)-\frac {2}{3} a b^3 \tan ^6(c+d x)-\frac {1}{7} b^4 \tan ^7(c+d x)}{d}\)

input
Int[Sec[c + d*x]^8*(a*Cos[c + d*x] + b*Sin[c + d*x])^4,x]
 
output
-((-(a^4*Tan[c + d*x]) - 2*a^3*b*Tan[c + d*x]^2 - (a^2*(a^2 + 6*b^2)*Tan[c 
 + d*x]^3)/3 - a*b*(a^2 + b^2)*Tan[c + d*x]^4 - (b^2*(6*a^2 + b^2)*Tan[c + 
 d*x]^5)/5 - (2*a*b^3*Tan[c + d*x]^6)/3 - (b^4*Tan[c + d*x]^7)/7)/d)
 

3.1.87.3.1 Defintions of rubi rules used

rule 522
Int[((e_.)*(x_))^(m_.)*((c_) + (d_.)*(x_))^(n_.)*((a_) + (b_.)*(x_)^2)^(p_. 
), x_Symbol] :> Int[ExpandIntegrand[(e*x)^m*(c + d*x)^n*(a + b*x^2)^p, x], 
x] /; FreeQ[{a, b, c, d, e, m, n}, x] && IGtQ[p, 0]
 

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3567
Int[cos[(c_.) + (d_.)*(x_)]^(m_.)*(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*si 
n[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[-d^(-1)   Subst[Int[x^m*((b 
+ a*x)^n/(1 + x^2)^((m + n + 2)/2)), x], x, Cot[c + d*x]], x] /; FreeQ[{a, 
b, c, d}, x] && IntegerQ[n] && IntegerQ[(m + n)/2] && NeQ[n, -1] &&  !(GtQ[ 
n, 0] && GtQ[m, 1])
 
3.1.87.4 Maple [A] (verified)

Time = 1.64 (sec) , antiderivative size = 166, normalized size of antiderivative = 1.16

method result size
parts \(-\frac {a^{4} \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )}{d}+\frac {b^{4} \left (\frac {\sin \left (d x +c \right )^{5}}{7 \cos \left (d x +c \right )^{7}}+\frac {2 \sin \left (d x +c \right )^{5}}{35 \cos \left (d x +c \right )^{5}}\right )}{d}+\frac {4 a \,b^{3} \left (\frac {\sec \left (d x +c \right )^{6}}{6}-\frac {\sec \left (d x +c \right )^{4}}{4}\right )}{d}+\frac {a^{3} b \sec \left (d x +c \right )^{4}}{d}+\frac {6 a^{2} b^{2} \left (\frac {\sin \left (d x +c \right )^{3}}{5 \cos \left (d x +c \right )^{5}}+\frac {2 \sin \left (d x +c \right )^{3}}{15 \cos \left (d x +c \right )^{3}}\right )}{d}\) \(166\)
derivativedivides \(\frac {-a^{4} \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )+\frac {a^{3} b}{\cos \left (d x +c \right )^{4}}+6 a^{2} b^{2} \left (\frac {\sin \left (d x +c \right )^{3}}{5 \cos \left (d x +c \right )^{5}}+\frac {2 \sin \left (d x +c \right )^{3}}{15 \cos \left (d x +c \right )^{3}}\right )+4 a \,b^{3} \left (\frac {\sin \left (d x +c \right )^{4}}{6 \cos \left (d x +c \right )^{6}}+\frac {\sin \left (d x +c \right )^{4}}{12 \cos \left (d x +c \right )^{4}}\right )+b^{4} \left (\frac {\sin \left (d x +c \right )^{5}}{7 \cos \left (d x +c \right )^{7}}+\frac {2 \sin \left (d x +c \right )^{5}}{35 \cos \left (d x +c \right )^{5}}\right )}{d}\) \(171\)
default \(\frac {-a^{4} \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )+\frac {a^{3} b}{\cos \left (d x +c \right )^{4}}+6 a^{2} b^{2} \left (\frac {\sin \left (d x +c \right )^{3}}{5 \cos \left (d x +c \right )^{5}}+\frac {2 \sin \left (d x +c \right )^{3}}{15 \cos \left (d x +c \right )^{3}}\right )+4 a \,b^{3} \left (\frac {\sin \left (d x +c \right )^{4}}{6 \cos \left (d x +c \right )^{6}}+\frac {\sin \left (d x +c \right )^{4}}{12 \cos \left (d x +c \right )^{4}}\right )+b^{4} \left (\frac {\sin \left (d x +c \right )^{5}}{7 \cos \left (d x +c \right )^{7}}+\frac {2 \sin \left (d x +c \right )^{5}}{35 \cos \left (d x +c \right )^{5}}\right )}{d}\) \(171\)
parallelrisch \(-\frac {2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{12} a^{4}-4 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{11} a^{3} b +\left (8 a^{2} b^{2}-\frac {14}{3} a^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{10}+\left (12 a^{3} b -8 a \,b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{9}+\left (-\frac {64}{5} a^{2} b^{2}+\frac {29}{3} a^{4}+\frac {16}{5} b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}+\left (-16 a^{3} b +\frac {8}{3} a \,b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}+\left (-12 a^{4}+\frac {48}{5} a^{2} b^{2}+\frac {96}{35} b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}+\left (16 a^{3} b -\frac {8}{3} a \,b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}+\left (-\frac {64}{5} a^{2} b^{2}+\frac {29}{3} a^{4}+\frac {16}{5} b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\left (-12 a^{3} b +8 a \,b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}+\left (8 a^{2} b^{2}-\frac {14}{3} a^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+4 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) a^{3} b +a^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right )^{7}}\) \(326\)
risch \(\frac {4 i \left (35 a^{4}+3 b^{4}-42 a^{2} b^{2}+105 a^{4} {\mathrm e}^{10 i \left (d x +c \right )}+21 b^{4} {\mathrm e}^{2 i \left (d x +c \right )}+210 b^{4} {\mathrm e}^{6 i \left (d x +c \right )}+105 b^{4} {\mathrm e}^{10 i \left (d x +c \right )}+420 i a \,b^{3} {\mathrm e}^{10 i \left (d x +c \right )}-420 i a^{3} b \,{\mathrm e}^{10 i \left (d x +c \right )}-630 a^{2} b^{2} {\mathrm e}^{10 i \left (d x +c \right )}-1260 i a^{3} b \,{\mathrm e}^{8 i \left (d x +c \right )}-420 i a^{3} b \,{\mathrm e}^{4 i \left (d x +c \right )}-1260 i a^{3} b \,{\mathrm e}^{6 i \left (d x +c \right )}+140 i a \,b^{3} {\mathrm e}^{8 i \left (d x +c \right )}+140 i a \,b^{3} {\mathrm e}^{6 i \left (d x +c \right )}+420 i a \,b^{3} {\mathrm e}^{4 i \left (d x +c \right )}+455 a^{4} {\mathrm e}^{8 i \left (d x +c \right )}-105 b^{4} {\mathrm e}^{8 i \left (d x +c \right )}+770 a^{4} {\mathrm e}^{6 i \left (d x +c \right )}+630 a^{4} {\mathrm e}^{4 i \left (d x +c \right )}-42 b^{4} {\mathrm e}^{4 i \left (d x +c \right )}+245 a^{4} {\mathrm e}^{2 i \left (d x +c \right )}-1050 a^{2} b^{2} {\mathrm e}^{8 i \left (d x +c \right )}-420 a^{2} b^{2} {\mathrm e}^{6 i \left (d x +c \right )}-252 a^{2} b^{2} {\mathrm e}^{4 i \left (d x +c \right )}-294 a^{2} b^{2} {\mathrm e}^{2 i \left (d x +c \right )}\right )}{105 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{7}}\) \(392\)

input
int(sec(d*x+c)^8*(cos(d*x+c)*a+b*sin(d*x+c))^4,x,method=_RETURNVERBOSE)
 
output
-a^4/d*(-2/3-1/3*sec(d*x+c)^2)*tan(d*x+c)+b^4/d*(1/7*sin(d*x+c)^5/cos(d*x+ 
c)^7+2/35*sin(d*x+c)^5/cos(d*x+c)^5)+4*a*b^3/d*(1/6*sec(d*x+c)^6-1/4*sec(d 
*x+c)^4)+a^3*b*sec(d*x+c)^4/d+6*a^2*b^2/d*(1/5*sin(d*x+c)^3/cos(d*x+c)^5+2 
/15*sin(d*x+c)^3/cos(d*x+c)^3)
 
3.1.87.5 Fricas [A] (verification not implemented)

Time = 0.24 (sec) , antiderivative size = 142, normalized size of antiderivative = 0.99 \[ \int \sec ^8(c+d x) (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=\frac {70 \, a b^{3} \cos \left (d x + c\right ) + 105 \, {\left (a^{3} b - a b^{3}\right )} \cos \left (d x + c\right )^{3} + {\left (2 \, {\left (35 \, a^{4} - 42 \, a^{2} b^{2} + 3 \, b^{4}\right )} \cos \left (d x + c\right )^{6} + {\left (35 \, a^{4} - 42 \, a^{2} b^{2} + 3 \, b^{4}\right )} \cos \left (d x + c\right )^{4} + 15 \, b^{4} + 6 \, {\left (21 \, a^{2} b^{2} - 4 \, b^{4}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )}{105 \, d \cos \left (d x + c\right )^{7}} \]

input
integrate(sec(d*x+c)^8*(a*cos(d*x+c)+b*sin(d*x+c))^4,x, algorithm="fricas" 
)
 
output
1/105*(70*a*b^3*cos(d*x + c) + 105*(a^3*b - a*b^3)*cos(d*x + c)^3 + (2*(35 
*a^4 - 42*a^2*b^2 + 3*b^4)*cos(d*x + c)^6 + (35*a^4 - 42*a^2*b^2 + 3*b^4)* 
cos(d*x + c)^4 + 15*b^4 + 6*(21*a^2*b^2 - 4*b^4)*cos(d*x + c)^2)*sin(d*x + 
 c))/(d*cos(d*x + c)^7)
 
3.1.87.6 Sympy [F(-1)]

Timed out. \[ \int \sec ^8(c+d x) (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=\text {Timed out} \]

input
integrate(sec(d*x+c)**8*(a*cos(d*x+c)+b*sin(d*x+c))**4,x)
 
output
Timed out
 
3.1.87.7 Maxima [A] (verification not implemented)

Time = 0.24 (sec) , antiderivative size = 151, normalized size of antiderivative = 1.06 \[ \int \sec ^8(c+d x) (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=\frac {35 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} a^{4} + 42 \, {\left (3 \, \tan \left (d x + c\right )^{5} + 5 \, \tan \left (d x + c\right )^{3}\right )} a^{2} b^{2} + 3 \, {\left (5 \, \tan \left (d x + c\right )^{7} + 7 \, \tan \left (d x + c\right )^{5}\right )} b^{4} - \frac {35 \, {\left (3 \, \sin \left (d x + c\right )^{2} - 1\right )} a b^{3}}{\sin \left (d x + c\right )^{6} - 3 \, \sin \left (d x + c\right )^{4} + 3 \, \sin \left (d x + c\right )^{2} - 1} + \frac {105 \, a^{3} b}{{\left (\sin \left (d x + c\right )^{2} - 1\right )}^{2}}}{105 \, d} \]

input
integrate(sec(d*x+c)^8*(a*cos(d*x+c)+b*sin(d*x+c))^4,x, algorithm="maxima" 
)
 
output
1/105*(35*(tan(d*x + c)^3 + 3*tan(d*x + c))*a^4 + 42*(3*tan(d*x + c)^5 + 5 
*tan(d*x + c)^3)*a^2*b^2 + 3*(5*tan(d*x + c)^7 + 7*tan(d*x + c)^5)*b^4 - 3 
5*(3*sin(d*x + c)^2 - 1)*a*b^3/(sin(d*x + c)^6 - 3*sin(d*x + c)^4 + 3*sin( 
d*x + c)^2 - 1) + 105*a^3*b/(sin(d*x + c)^2 - 1)^2)/d
 
3.1.87.8 Giac [A] (verification not implemented)

Time = 0.45 (sec) , antiderivative size = 144, normalized size of antiderivative = 1.01 \[ \int \sec ^8(c+d x) (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=\frac {15 \, b^{4} \tan \left (d x + c\right )^{7} + 70 \, a b^{3} \tan \left (d x + c\right )^{6} + 126 \, a^{2} b^{2} \tan \left (d x + c\right )^{5} + 21 \, b^{4} \tan \left (d x + c\right )^{5} + 105 \, a^{3} b \tan \left (d x + c\right )^{4} + 105 \, a b^{3} \tan \left (d x + c\right )^{4} + 35 \, a^{4} \tan \left (d x + c\right )^{3} + 210 \, a^{2} b^{2} \tan \left (d x + c\right )^{3} + 210 \, a^{3} b \tan \left (d x + c\right )^{2} + 105 \, a^{4} \tan \left (d x + c\right )}{105 \, d} \]

input
integrate(sec(d*x+c)^8*(a*cos(d*x+c)+b*sin(d*x+c))^4,x, algorithm="giac")
 
output
1/105*(15*b^4*tan(d*x + c)^7 + 70*a*b^3*tan(d*x + c)^6 + 126*a^2*b^2*tan(d 
*x + c)^5 + 21*b^4*tan(d*x + c)^5 + 105*a^3*b*tan(d*x + c)^4 + 105*a*b^3*t 
an(d*x + c)^4 + 35*a^4*tan(d*x + c)^3 + 210*a^2*b^2*tan(d*x + c)^3 + 210*a 
^3*b*tan(d*x + c)^2 + 105*a^4*tan(d*x + c))/d
 
3.1.87.9 Mupad [B] (verification not implemented)

Time = 24.21 (sec) , antiderivative size = 186, normalized size of antiderivative = 1.30 \[ \int \sec ^8(c+d x) (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=\frac {\frac {b^4\,\sin \left (c+d\,x\right )}{7}-{\cos \left (c+d\,x\right )}^3\,\left (a\,b^3-a^3\,b\right )-{\cos \left (c+d\,x\right )}^2\,\left (\frac {8\,b^4\,\sin \left (c+d\,x\right )}{35}-\frac {6\,a^2\,b^2\,\sin \left (c+d\,x\right )}{5}\right )+{\cos \left (c+d\,x\right )}^4\,\left (\frac {\sin \left (c+d\,x\right )\,a^4}{3}-\frac {2\,\sin \left (c+d\,x\right )\,a^2\,b^2}{5}+\frac {\sin \left (c+d\,x\right )\,b^4}{35}\right )+{\cos \left (c+d\,x\right )}^6\,\left (\frac {2\,\sin \left (c+d\,x\right )\,a^4}{3}-\frac {4\,\sin \left (c+d\,x\right )\,a^2\,b^2}{5}+\frac {2\,\sin \left (c+d\,x\right )\,b^4}{35}\right )+\frac {2\,a\,b^3\,\cos \left (c+d\,x\right )}{3}}{d\,{\cos \left (c+d\,x\right )}^7} \]

input
int((a*cos(c + d*x) + b*sin(c + d*x))^4/cos(c + d*x)^8,x)
 
output
((b^4*sin(c + d*x))/7 - cos(c + d*x)^3*(a*b^3 - a^3*b) - cos(c + d*x)^2*(( 
8*b^4*sin(c + d*x))/35 - (6*a^2*b^2*sin(c + d*x))/5) + cos(c + d*x)^4*((a^ 
4*sin(c + d*x))/3 + (b^4*sin(c + d*x))/35 - (2*a^2*b^2*sin(c + d*x))/5) + 
cos(c + d*x)^6*((2*a^4*sin(c + d*x))/3 + (2*b^4*sin(c + d*x))/35 - (4*a^2* 
b^2*sin(c + d*x))/5) + (2*a*b^3*cos(c + d*x))/3)/(d*cos(c + d*x)^7)